<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<c:import url="/jsp/pager/pagerForm.jsp"></c:import>

<form method="post" rel="pagerForm" action="<c:url value='/salesInvoice/showList'/>"
	onsubmit="return navTabSearch(this)">
	<div class="pageHeader">
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td><label>关键词：</label> <input type="text" name="keywords" value="${param.keywords}" /></td>
				</tr>
				<tr>
					<td><label>客户名称：</label> <input type="text" name="customer" value="${param.customer}" /></td>
					<td><label>发票类型：</label> <select name="invoiceType" class="combox">
							<option value="">请选择</option>
							<c:forEach var="item" items="${invoiceTypeList}">
								<option value="${item.type}" ${item.type eq param.invoiceType ? 'selected="selected"' : ''}>${item.type}</option>
							</c:forEach>
					</select></td>
					<td><label>所属月份：</label> <input name="abstractMonth" class="date" type="text" value="${param.abstractMonth}"
						readonly=" true" dateFmt="yyyy-M" /></td>
					<td><label>开票日期：</label> <input name="invoiceDate" class="date" type="text" value="${param.invoiceDate}"
						readonly=" true" dateFmt="yyyy-M-d" /></td>
				</tr>
			</table>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit">搜索</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</div>
</form>

<div class="pageContent">

	<div class="panelBar">
		<ul class="toolBar">
			<c:if test="${sessionInfo.role == '管理员' || sessionInfo.role == '财务' || sessionInfo.role == '财务助理'}">
				<li><a class="add" target="dialog" width="530" height="470" rel="salesInvoiceAdd" mask="true"
					href="<c:url value='/salesInvoice/showAdd'/>" title="添加销项发票"><span>添加</span></a></li>
				<li><a class="edit" target="dialog" width="530" height="470" rel="salesInvoiceEdit" mask="true"
					href="<c:url value='/salesInvoice/showEdit/{slt_objId}'/>" title="编辑销项发票"><span>编辑</span></a></li>
				<li><a class="delete" target="ajaxTodo" href="<c:url value='/salesInvoice/delete/{slt_objId}'/>"
					title="你确定要删除吗?"><span>删除</span></a></li>
			</c:if>
			<li class="line">line</li>
			<li><a class="icon" href="javascript:$.printBox('salesInvoice_list_print')"><span>打印</span></a></li>
		</ul>
	</div>

	<div id="salesInvoice_list_print">
		<table class="list" width="1200" targetType="navTab" asc="asc" desc="desc" layoutH="141">
			<thead>
				<tr>
					<th width="5%">合计</th>
					<th width="95%" colspan="12">开票金额：${total.amount}</th>
				</tr>
				<tr>
					<th width="5%">序号</th>
					<th width="5%" orderField="orderNo" class="${pageHelper.orderField eq 'orderNo' ? param.orderDirection : ''}">单据编号</th>
					<th width="15%" orderField="customer" class="${pageHelper.orderField eq 'customer' ? param.orderDirection : ''}">客户名称</th>
					<th width="5%" orderField="salesman" class="${pageHelper.orderField eq 'salesman' ? param.orderDirection : ''}">业务员</th>
					<th width="5%" orderField="drawer" class="${pageHelper.orderField eq 'drawer' ? param.orderDirection : ''}">开票人</th>
					<th width="10%" orderField="invoiceDate"
						class="${pageHelper.orderField eq 'invoiceDate' ? param.orderDirection : ''}">开票日期</th>
					<th width="5%" orderField="invoiceNo" class="${pageHelper.orderField eq 'invoiceNo' ? param.orderDirection : ''}">发票号</th>
					<th width="8%" orderField="invoiceType"
						class="${pageHelper.orderField eq 'invoiceType' ? param.orderDirection : ''}">发票类型</th>
					<th width="7%" orderField="ai" class="${pageHelper.orderField eq 'ai' ? param.orderDirection : ''}">摘要</th>
					<th width="7%" orderField="orderAmount"
						class="${pageHelper.orderField eq 'orderAmount' ? param.orderDirection : ''}">订单金额</th>
					<th width="7%" orderField="amount" class="${pageHelper.orderField eq 'amount' ? param.orderDirection : ''}">开票金额</th>
					<th width="5%" orderField="abstractMonth"
						class="${pageHelper.orderField eq 'abstractMonth' ? param.orderDirection : ''}">所属月份</th>
					<th width="9%" orderField="remarks" class="${pageHelper.orderField eq 'remarks' ? param.orderDirection : ''}">备注</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach var="item" items="${salesInvoiceList}" varStatus="s">
					<tr target="slt_objId" rel="${item.id }">
						<td>${s.index + 1}</td>
						<td>${item.orderNo}</td>
						<td>${item.customer}</td>
						<td>${item.salesman}</td>
						<td>${item.drawer}</td>
						<td>${item.invoiceDate}</td>
						<td>${item.invoiceNo}</td>
						<td>${item.invoiceType}</td>
						<td>${item.ai}</td>
						<td>${item.orderAmount}</td>
						<td>${item.amount}</td>
						<td>${item.abstractMonth}</td>
						<td>${item.remarks}</td>
					</tr>
				</c:forEach>
			</tbody>
		</table>
	</div>

	<c:import url="/jsp/pager/panelBar.jsp"></c:import>

</div>
